package com.bwie.controller;

import com.bwie.pojo.TbBrand;
import com.bwie.service.TbBrandService;
import com.bwie.utils.R;
import com.bwie.utils.Rest;
import com.bwie.vo.PageInfoVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/brand/index")
public class IndexController {

    @Autowired
    TbBrandService brandService;

    @ApiOperation("添加品牌")
    @PostMapping("/addBrand")
    public Rest addBrand(@RequestBody TbBrand brand){

        return brandService.addBrand(brand);
    }

    @ApiOperation("品牌分页查询")
    @PostMapping("/brandList")
    public R brandList(@RequestBody PageInfoVo pageInfoVo){

        return brandService.brandList(pageInfoVo);
    }


    @ApiOperation("修改用品牌状态")
    @PostMapping("/updataStatus")
    public R updataStatus(@RequestBody TbBrand tbBrand){

        return brandService.updataStatus(tbBrand);
    }



}
